
package com.x52im.rbchat.logic.chat_root.model;

import com.google.gson.Gson;

import java.io.Serializable;

/**
 * 位置消息的位置信息元数据.
 *
 * @author JackJiang
 * @since 6.0
 */
public class LocationMeta implements Serializable {
    /** 位置主描述 */
    private String locationTitle;
    /** 位置详细描述 */
    private String locationContent;
    /** 经度 */
    private double longitude;
    /** 纬度 */
    private double latitude;

    /** 地图预览图缓存文件名（此字段可为空，为空表示发送者没有成功截屏到此预览图） */
    private String prewviewImgFileName;

    public void setLocationTitle(String locationTitle) {
        this.locationTitle = locationTitle;
    }

    public void setLocationContent(String locationContent) {
        this.locationContent = locationContent;
    }

    public void setLatitude(double latitude) {
        this.latitude = latitude;
    }

    public void setLongitude(double longitude) {
        this.longitude = longitude;
    }

    public String getLocationTitle() {
        return locationTitle;
    }

    public String getLocationContent() {
        return locationContent;
    }

    public double getLatitude() {
        return latitude;
    }

    public double getLongitude() {
        return longitude;
    }

    public void setPrewviewImgFileName(String prewviewImgFileName) {
        this.prewviewImgFileName = prewviewImgFileName;
    }

    public String getPrewviewImgFileName() {
        return prewviewImgFileName;
    }

    public static LocationMeta fromJSON(String jsonOfLocationMeta) {
        return new Gson().fromJson(jsonOfLocationMeta, LocationMeta.class);
    }
}
